package org.framework.bean;

import org.framework.utils.CastUtil;

import java.util.Map;

/**
 * 请求参数
 * @Author xuelongjiang
 */
public class Param {


    private Map<String,Object> paramMap;

    public Param(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    public Map<String,Object> getMap(){
        return paramMap;
    }

    //
    //获取不同类型的返回参数值 long,double,int, string,float,boolean
    //



    public long getLong(String  name){
        return CastUtil.castLong(paramMap.get(name));
    }

    public int getInt(String name){
        return CastUtil.castInt(paramMap.get(name));
    }

    public double getDouble(String name){
        return CastUtil.castDouble(paramMap.get(name));
    }

    public String getString(String name){
        return CastUtil.castString(paramMap.get(name));
    }

    public float getFloat(String name){
        return CastUtil.castFloat(paramMap.get(name));
    }


    public boolean getBoolean(String name){
        return  CastUtil.castBoolean(paramMap.get(name));
    }





}
